package cn.edu.bjtu.toychange.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;


/**
 * The persistent class for the requisition database table.
 * 
 */
@Entity
//@NamedQuery(name="Requisition.findAll", query="SELECT r FROM Requisition r")
public class Requisition implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int r_requisitionID;

	private String r_reqMesgt;

	private int r_reqState;

	@Temporal(TemporalType.DATE)
	private Date r_reqTime;

	//bi-directional many-to-one association to Toy
	@ManyToOne
	@JoinColumn(name="R_senderToyID")
	private Toy toy1;

	//bi-directional many-to-one association to Toy
	@ManyToOne
	@JoinColumn(name="R_ownerToyID")
	private Toy toy2;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="R_receiverID")
	private User user1;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="R_senderID")
	private User user2;

	public Requisition() {
	}

	public int getR_requisitionID() {
		return this.r_requisitionID;
	}

	public void setR_requisitionID(int r_requisitionID) {
		this.r_requisitionID = r_requisitionID;
	}

	public String getR_reqMesgt() {
		return this.r_reqMesgt;
	}

	public void setR_reqMesgt(String r_reqMesgt) {
		this.r_reqMesgt = r_reqMesgt;
	}

	public int getR_reqState() {
		return this.r_reqState;
	}

	public void setR_reqState(int r_reqState) {
		this.r_reqState = r_reqState;
	}

	public Date getR_reqTime() {
		return this.r_reqTime;
	}

	public void setR_reqTime(Date r_reqTime) {
		this.r_reqTime = r_reqTime;
	}

	public Toy getToy1() {
		return this.toy1;
	}

	public void setToy1(Toy toy1) {
		this.toy1 = toy1;
	}

	public Toy getToy2() {
		return this.toy2;
	}

	public void setToy2(Toy toy2) {
		this.toy2 = toy2;
	}

	public User getUser1() {
		return this.user1;
	}

	public void setUser1(User user1) {
		this.user1 = user1;
	}

	public User getUser2() {
		return this.user2;
	}

	public void setUser2(User user2) {
		this.user2 = user2;
	}

}